package com.iguo.news.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iguo.news.entity.User;
import com.iguo.news.mapper.UserMapper;
import com.iguo.news.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author xiaoniao
 * @date 2023/2/17 13:33
 */
@Service
@RequiredArgsConstructor
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

  final UserMapper userMapper;

  @Override
  public Boolean deleteByName(String username) {

    Integer integer = userMapper.deleteByName(username);
    if(integer > 0){
      return true;
    }
    return false;
  }


  @Override
  public Boolean updateUserById(User user) {
    Integer result = userMapper.updateInfo(user);
    if(result > 0)
      return true;
    return false;
  }
}
